package com.ruoyi.transaction.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.transaction.mapper.CarTransactionMapper;
import com.ruoyi.transaction.domain.CarTransaction;
import com.ruoyi.transaction.service.ICarTransactionService;

/**
 * 交易记录Service业务层处理
 * 
 * @author huxiqing
 * @date 2025-04-07
 */
@Service
public class CarTransactionServiceImpl implements ICarTransactionService 
{
    @Autowired
    private CarTransactionMapper carTransactionMapper;

    /**
     * 查询交易记录
     * 
     * @param transactionId 交易记录主键
     * @return 交易记录
     */
    @Override
    public CarTransaction selectCarTransactionByTransactionId(Long transactionId)
    {
        return carTransactionMapper.selectCarTransactionByTransactionId(transactionId);
    }

    /**
     * 查询交易记录列表
     * 
     * @param carTransaction 交易记录
     * @return 交易记录
     */
    @Override
    public List<CarTransaction> selectCarTransactionList(CarTransaction carTransaction)
    {
        return carTransactionMapper.selectCarTransactionList(carTransaction);
    }

    /**
     * 新增交易记录
     * 
     * @param carTransaction 交易记录
     * @return 结果
     */
    @Override
    public int insertCarTransaction(CarTransaction carTransaction)
    {
        carTransaction.setCreateTime(DateUtils.getNowDate());
        return carTransactionMapper.insertCarTransaction(carTransaction);
    }

    /**
     * 修改交易记录
     * 
     * @param carTransaction 交易记录
     * @return 结果
     */
    @Override
    public int updateCarTransaction(CarTransaction carTransaction)
    {
        carTransaction.setUpdateTime(DateUtils.getNowDate());
        return carTransactionMapper.updateCarTransaction(carTransaction);
    }

    /**
     * 批量删除交易记录
     * 
     * @param transactionIds 需要删除的交易记录主键
     * @return 结果
     */
    @Override
    public int deleteCarTransactionByTransactionIds(Long[] transactionIds)
    {
        return carTransactionMapper.deleteCarTransactionByTransactionIds(transactionIds);
    }

    /**
     * 删除交易记录信息
     * 
     * @param transactionId 交易记录主键
     * @return 结果
     */
    @Override
    public int deleteCarTransactionByTransactionId(Long transactionId)
    {
        return carTransactionMapper.deleteCarTransactionByTransactionId(transactionId);
    }
}
